package studyOwn;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;

public class FileOutputStreamDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fileOutputStream = new FileOutputStream("funCode\\fos.txt");

        FileOutputStream fileOutputStream1 = new FileOutputStream(new File("funCode\\fos.txt"));
        /*
        System.out.println(fileOutputStream);
        System.out.println(fileOutputStream1);
        */
        // fileOutputStream.write(97);
        //byte[] bytes = {31,32,33,34,35,97};
        byte[] bytes = " i bo si ".getBytes(StandardCharsets.UTF_8);
        //fileOutputStream1.write(bytes);
        fileOutputStream.write(bytes,0,4);
        fileOutputStream.close();
        fileOutputStream1.close();

    }
}
